package com.netty.junjie.constant;

import lombok.Data;

/**
 * *
 * ConstantBytes常量类 (用于byte字节的数量定义)
 *
 * @author JunJie
 * @Date 2020/07/13 07:13
 **/
@Data
public class ConstantBytes {

    /**
     * 除于数
     */
    public static final int DIVIDE_BY_NUMBER = 2;

    /**
     * 包头字节数
     */
    public static final int PACKET_HEADER_BYTES = 2;

    /**
     * 数据长度
     */
    public static final int DATA_LENGTH = 2;

    /**
     * 客户端IP地址
     */
    public static final int CLIENT_ADDRESS = 4;

    /**
     * 服务器IP地址
     */
    public static final int SERVER_ADDRESS = 4;

    /**
     * 协议版本号
     */
    public static final int AGREEMENT_VERSION = 1;

    /**
     * 数据类型
     */
    public static final int DATA_TYPE = 1;

    /**
     * 包序号
     */
    public static final int PACKAGE_NUMBER = 2;

    /**
     * 系统时间
     */
    public static final int SYSTEM_TIME = 4;

    /**
     * 发送端的MAC地址
     */
    public static final int MAC_ADDRESS = 10;

    /**
     * 预留位
     */
    public static final int RESERVED = 2;

    /**
     * 校验位
     */
    public static final int CHECK_BIT = 2;

    /**
     * 数据域 N*12
     */
    public static final int DATA_FIELD = 12;

    /**
     * 包结束位
     */
    public static final int PACKET_END_BIT = 2;

    /**
     * 可读最小字节数
     */
    public static final int BYTE_MIN_NUMBER = PACKET_HEADER_BYTES + DATA_LENGTH + CLIENT_ADDRESS + SERVER_ADDRESS + AGREEMENT_VERSION + DATA_TYPE + PACKAGE_NUMBER
            + SYSTEM_TIME + MAC_ADDRESS + RESERVED + CHECK_BIT + DATA_FIELD + PACKET_END_BIT;
}
